package br.ufmg.notservice.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import br.ufmg.notservice.utils.AndroidUtils;

public abstract class AbstractReceiver extends BroadcastReceiver {

	protected static int id;
	
	@Override
	public void onReceive(Context context, Intent intent) {
		AndroidUtils.showAlert(context, "Receiving broadcast: " + getClass().getSimpleName());

		Log.i(getClass().getSimpleName(), "Received intent: " + intent);

	}

	protected void startService(Context context, Intent intent)
	{
		Log.i(getClass().getSimpleName(), "Starting service " + intent.getAction());
		context.startService(intent);
	}
	
	protected abstract Class <?> getServiceClass();
	
//	protected void startService(Context context, Class <?> cls, String action)
//	{
//		Intent intent = new Intent(action);
//		intent.setClass(context, cls);
//		startService(context, intent);
//	}
}
